<template>
    <div>
      <el-button @click="fetchMessage">Click Me</el-button>
      <p>{{ message }}</p>
    </div>
  </template>
  
  <script>
  import axios from 'axios';
  
  export default {
    data() {
      return {
        message: '',
      };
    },
    methods: {
      async fetchMessage() {
        try {
          const response = await axios.get('http://127.0.0.1:8000/api/hello');
          this.message = response.data.message;
        } catch (error) {
          console.error(error);
        }
      },
    },
  };
  </script>
  